/*
 * Configuracion teclas entre otras cosas
 *
 * This is part of the game The Rooms
 * Copyright (C) 2010  Elvio Sarquis
 *
 * Get the GNU GPL v3 in http://www.gnu.org/licenses/
 */
package rooms;

/**
 *
 * @author dask
 */
public class Keys {

    public static int UP = 125;
    public static int UPRIGHT = 126;
    public static int UPLEFT = 124;
    public static int RIGHT = 123;
    public static int LEFT = 121;
    public static int DOWN = 119;
    public static int DOWNRIGHT = 120;
    public static int DOWNLEFT = 118;
    public static int ARROWUP = 0;
    public static int ARROWDOWN = 1;
    public static int ARROWLEFT = 2;
    public static int ARROWRIGHT = 3;
    public static int WAIT = 122;
    public static int ESC = 30;
    public static int FIRE = 69;
    public static int INVENT = 72;
    public static int PICKUP = 37;
    public static int SPACEBAR = 40;
    public static int ENTER = 10;

    public static boolean isGameKey(int key) {
        boolean is = false;

        if (key == UPLEFT || key == UP || key == UPRIGHT || key == LEFT || key == RIGHT || key == DOWNLEFT || key == DOWN || key == DOWNRIGHT
                || key == ARROWUP || key == ARROWLEFT || key == ARROWRIGHT || key == ARROWDOWN ||key == WAIT || key == ESC || key == FIRE
                || key == INVENT || key == PICKUP) {
            is = true;
        }

        return is;
    }

    public static boolean isMoveKey(int key) {
        boolean is = false;

        if (key == UPLEFT || key == UP || key == UPRIGHT || key == LEFT || key == RIGHT || key == DOWNLEFT || key == DOWN || key == DOWNRIGHT||
                key == ARROWUP || key == ARROWLEFT || key == ARROWRIGHT || key == ARROWDOWN) {
            is = true;
        }

        return is;
    }

    public static boolean isActionKey(int key) {
        boolean is = false;

        if (key == WAIT || key == FIRE || key == INVENT || key == PICKUP || key == ESC){
            is = true;
        }
        return is;
    }

    public static boolean isMenuKey(int key) {
        boolean is = false;

        if (key == ENTER || key == SPACEBAR || key == ESC || key == ARROWUP || key == ARROWLEFT || key == ARROWRIGHT
                || key == ARROWDOWN){
            is = true;
        }
        return is;
    }

    public static boolean isEtcKey(int key) {
        boolean is = false;

        if (key == ESC || key == WAIT) {
            is = true;
        }

        return is;
    }
}
